import request from '@/utils/request'

// 获取经纬度坐标
export function getInfo(id) {
  return request({
    url: 'products/info',
    method: 'get',
    params: {
      id: id // 将参数添加到请求中
    }
  })
}

export function getMerchantSearch(queryParams) {
  return request({
    url: 'merchant/list',
    method: 'post',
    params: {
      pageSize: queryParams.pageSize,// 将参数添加到请求中
      pageNum: queryParams.pageNum // 将参数添加到请求中
    }
  })
}

export function getProductsList(id, productName, userId, queryParams) {
  return request({
    url: 'products/products/list',
    method: 'get',
    params: {
      pageSize: queryParams.pageSize,// 将参数添加到请求中
      pageNum: queryParams.pageNum,// 将参数添加到请求中
      id: id, // 将参数添加到请求中
      productName: productName,
      userId: userId
    },
  })
}

export function getList(queryParams, query) {
  return request({
    url: 'products/list',
    method: 'post',
    data: query,
    params: {
      pageSize: queryParams.pageSize,// 将参数添加到请求中
      pageNum: queryParams.pageNum // 将参数添加到请求中
    }
  })
}

export function getInfoMerchan(id) {
  return request({
    url: 'merchant/info',
    method: 'get',
    params: {
      id: id
    },
  })
}



export function getMerchantTransactions(id) {
  return request({
    url: 'merchant/getTransactionRecords',
    method: 'get',
    params: {
      id: id
    },
  })
}


export function getRansactionRecords(id) {
  return request({
    url: 'order/info',
    method: 'get',
    params: {
      orderId: id
    },
  })
}
